package time.types.ds;

/**
 * ...
 * @author waneck
 */
#if stax
typedef Option<T> = Prelude.Option<T>;

typedef Either<A, B> = Prelude.Either<A,B>;

typedef FailureOfSuccess<A, B> = Either<A, B>;
#else

/** An option represents an optional value -- the value may or may not be
 * present. Option is a much safer alternative to null that often enables
 * reduction in code size and increase in code clarity.
 */
enum Option<T>
{
	None;
	Some(of:T);
}

/** Either represents a type that is either a "left" value or a "right" value,
 * but not both. Either is often used to represent success/failure, where the
 * left side represents failure, and the right side represents success.
 */
enum Either<A, B> {
  Left(v: A);
  Right(v: B);
}

typedef FailureOrSuccess<A, B> = Either<A, B>
#end